package io.renren.modules.app.controller;

import io.renren.common.utils.ResultInfo;
import io.renren.modules.app.entity.TZnmhAppMenu;
import io.renren.modules.app.entity.TZnmhAppVersion;
import io.renren.modules.app.entity.TZnmhAppVersionRole;
import io.renren.modules.app.service.TZnmhAppMenuService;
import io.renren.modules.app.service.TZnmhAppVersionRoleService;
import io.renren.modules.app.service.TZnmhAppVersionService;
import io.renren.modules.app.service.TZnmhFunctionVersionMenuService;
import io.renren.modules.app.utils.RandomUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author limeng
 * @time 2018/11/12
 */
@RestController
@RequestMapping("test/")
public class TestController {

    @Resource
    TZnmhAppMenuService tZnmhAppMenuService;

    @Resource
    TZnmhAppVersionService tZnmhAppVersionService;

    @Resource
    TZnmhAppVersionRoleService tZnmhAppVersionRoleService;

    @Resource
    TZnmhFunctionVersionMenuService tZnmhFunctionVersionMenuService;

    /**
     * 版本数据迁移
     * @return
     */
    @GetMapping("getVersion")
    public ResultInfo getVersion(){
        return ResultInfo.success(tZnmhAppVersionService.getVersion());
    }

    /**
     * 版本角色数据迁移
     * @return
     */
    @GetMapping("getVersionRole")
    public ResultInfo getVersionRole(){
        return ResultInfo.success(tZnmhAppVersionService.getAllVersionRole());
    }

    /**
     * 版本角色菜单关系数据迁移
     * @return
     */
    @GetMapping("getVersionRoleMenu")
    public ResultInfo getVersionRoleMenu(){
        return tZnmhFunctionVersionMenuService.getVersionRoleMenu();
    }


}
